<?php

namespace Common\Model;

use Common\Model\AiModel;


class UserModel extends AiModel
{
    protected $_auto = array(
        array('add_time', 'strtotime', 3, 'function'),
        array('add_ip', 'getclientip', 3, 'function'),
    );

    /**
     * @param int $user_id
     * 获取用户年龄
     */
    public function getAge($user_id=0){
        $bday = $this->where("id={$user_id}")->getField('bday');
        return get_user_age($bday);
    }

    public function toUidGetInfo($uid){
      $where['id']=$uid;
      return $this->where($where)->find();
    }
}
